package com.pencilisland.pay.mgt.app.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.pencilisland.pay.mgt.app.entity.TenantEntity;

public interface TenantRepository extends JpaRepository<TenantEntity, Long>, JpaSpecificationExecutor<TenantEntity> {

	@Query("select max(a.loginName) from TenantEntity a where 1=1 order by a.loginName desc")
	String findMaxLoginName();

	TenantEntity findByUserId(Long userId);

	TenantEntity findByCode(String code);


}
